#include "SQLDropLogFileGroupStatement.h"

#include "SQLDDLStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../SQLName.h"
#include "../SQLExpr.h"
#include "../SQLObject.h"
#include "../../../DbType.h"
#include "../../../utils/instanceof.h"

SQLDropLogFileGroupStatement::SQLDropLogFileGroupStatement()
{
}

SQLDropLogFileGroupStatement::SQLDropLogFileGroupStatement(DbType_ptr  dbType)
    : SQLStatementImpl(dbType)
{
}

void SQLDropLogFileGroupStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLDropLogFileGroupStatement)))
  {
    acceptChild(visitor, name);
    acceptChild(visitor, engine);
  }
  visitor->endVisit(SharedObject(SQLDropLogFileGroupStatement));
}

SQLName_ptr SQLDropLogFileGroupStatement::getName()
{
  return name;
}

void SQLDropLogFileGroupStatement::setName(SQLName_ptr x)
{
  if (x != NULL)
  {
    x->setParent(SharedObject(SQLDropLogFileGroupStatement));
  }
  this->name = x;
}

SQLExpr_ptr SQLDropLogFileGroupStatement::getEngine()
{
  return engine;
}

void SQLDropLogFileGroupStatement::setEngine(SQLExpr_ptr x)
{
  if (x != NULL)
  {
    x->setParent(SharedObject(SQLDropLogFileGroupStatement));
  }
  this->engine = x;
}

SQLObject_list_ptr  SQLDropLogFileGroupStatement::getChildren()
{
  SQLObject_list_ptr  children = std::make_shared<std::list<SQLObject_ptr>>();
  if (name != NULL)
  {
    children->push_back(std::dynamic_pointer_cast<SQLObject>(name));
  }
  return children;
}
